/*
*  Copyright 2019-2020 Zheng Jie
*
*  Licensed under the Apache License, Version 2.0 (the "License");
*  you may not use this file except in compliance with the License.
*  You may obtain a copy of the License at
*
*  http://www.apache.org/licenses/LICENSE-2.0
*
*  Unless required by applicable law or agreed to in writing, software
*  distributed under the License is distributed on an "AS IS" BASIS,
*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*  See the License for the specific language governing permissions and
*  limitations under the License.
*/
package me.zhengjie.modules.enrstu.service;

import me.zhengjie.modules.enrstu.domain.School;
import me.zhengjie.modules.enrstu.service.dto.SchoolCreateOrUpdate;
import me.zhengjie.modules.enrstu.service.dto.SchoolDto;
import me.zhengjie.modules.enrstu.service.dto.SchoolQueryCriteria;
import me.zhengjie.modules.system.domain.Dept;
import me.zhengjie.utils.PageResult;
import org.springframework.data.domain.Pageable;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

/**
* @website https://eladmin.vip
* @description 学校管理-服务接口
* @author yyx
* @date 2024-10-14
**/
public interface SchoolService {

    /**
    * 查询数据分页
    * @param criteria 条件
    * @param pageable 分页参数
    * @return Map<String,Object>
    */
    PageResult<SchoolDto> queryAll(SchoolQueryCriteria criteria, Pageable pageable);

    /**
    * 查询所有数据不分页
    * @param criteria 条件参数
    * @return List<SchoolDto>
    */
    List<SchoolDto> queryAll(SchoolQueryCriteria criteria);


    /**
     * 根据ID查询
     * @param schoolId ID
     * @return SchoolDto
     */
    SchoolDto findById(String schoolId);

    /**
    * 创建
    * @param resources /
    */

    void create(School resources);

    /**
    * 编辑
    * @param resources /
    */
    void update(SchoolCreateOrUpdate resources);

    /**
    * 删除
    * @param id /
    */
    void deleteAll(String id) ;

    /**
    * 导出数据
    * @param all 待导出的数据
    * @param response /
    * @throws IOException /
    */
    void download(List<SchoolDto> all, HttpServletResponse response) throws IOException;


    /**
     * 根据学校地址查询出所在地址教育局列表
     * @return /
     */
    List<Dept> queryEducationAll();

    /**
     * 根据学区id查询学校总数
     * @param schoolDistrictId /
     * @return /
     */
    Long total(String schoolDistrictId);



    /**
     * 根据学区id查询对应学校的列表
     * @param schoolDistrictId /
     * @return /
     */
    List<SchoolDto> querySchoolList(String schoolDistrictId);
    /**
     * 就近分配：返回对应学校
     * @param communityAdId/
     * @return /
     */
    List<SchoolDto> findSchoolList(Long communityAdId, boolean isPolicyCare);



    /**
     * 导出导入学校模版
     * @param response
     */
    void download(HttpServletResponse response);
}